home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light ROM 1
/
LIGHT-ROM 1 (Amiga Library Services)(1994).iso
/
ffdisks
/
d936.lha
/
TKEd
/
Rexx
/
Count-Words.tked
< prev
next >
Wrap
Text File
|
1993-12-20
|
1KB
|
34 lines
/** ----------------------------------------------------
** ARexx program to count the number of words in a file
** ----------------------------------------------------
** AREXX-Programm, das die Wörter eines Textes zählt
** ----------------------------------------------------
**
** © Tom Kroener '92
**
**/
options results
address 'TKEd.1' /* Portname of the first started TKEd */
LF = '0A'X /* 'Linefeed' */
BeginOfFile /* Go to start */
LastLine /* Get number of the last line */
LastLineNr = result
Words = 0 /* Counter for the words */
LineNr = 1 /* Counter for the lines */
DO WHILE LineNr <= LastLineNr /* Counts until it reaches the last line */
GetLine /* Returns the current line of the text */
Words = Words + WORDS(result) /* Add the number of words of this line */
Cursor "DOWN" /* Goto next line */
LineNr = LineNr + 1 /* Increment linecounter */
END
LineNr = LineNr - 1
Request1 "Counted" Words "Words in" LineNr "Lines"
/* Brings up a requester with a message */
/* "TKED" forces the requester to
appear on TKEd's screen */
EXIT 0